export type DeleteApiV1AccountsAccountIdPlaylistsPlaylistIdArgs = {account_id: string, playlist_id: string, 'Content-Type': string, Authorization: string}; export type DeleteApiV1AccountsAccountIdPlaylistsPlaylistIdOptions = {baseUrl?: string | undefined, BCOAuth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Playlist * * DELETE /v1/accounts/{{account_id}}/playlists/{{playlist_id}} */ export const deleteApiV1AccountsAccountIdPlaylistsPlaylistId = async (args: DeleteApiV1AccountsAccountIdPlaylistsPlaylistIdArgs, options?: DeleteApiV1AccountsAccountIdPlaylistsPlaylistIdOptions) => { const {baseUrl = "https://cms.api.brightcove.com", fetch: fetchFn = fetch, BCOAuth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['Content-Type'] != null) headers.set("Content-Type", String(args['Content-Type'])) if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) if (BCOAuth2 !== undefined) headers.set('authorization', `Bearer ${BCOAuth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/accounts/${encodeURIComponent(String(args['{account_id']))}}/playlists/${encodeURIComponent(String(args['{playlist_id']))}}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };